package com.blockmeta.bbs.businesslibrary.pojo.websocket;


import com.blockmeta.bbs.baselibrary.utils.gson.GsonUtil;

import java.io.Serializable;


/**
 * Created by bytom on 2018/3/26.
 */

public class BasePOJO implements Serializable {
    private static final long serialVersionUID = 1L;
    String m_nPacketType;
    int m_seq;
    transient POJOCache m_cache = new POJOCache(false);

    public BasePOJO() {
    }

    public String get_pt() {
        return m_nPacketType;
    }

    public void set_pt(String m_nPacketType) {
        this.m_nPacketType = m_nPacketType;
    }

    public int get_seq() {
        return m_seq;
    }

    public void set_seq(int m_seq) {
        this.m_seq = m_seq;
    }


    public String toJsonString() {
        if(this.m_cache == null) {
            this.m_cache = new POJOCache(false);
        }

        String ret = this.m_cache.getJsonString();
        if(ret == null) {
            ret = GsonUtil.buildGson().toJson(this);
            this.m_cache.setJsonStringCache(ret);
        }

        return ret;
    }



}
